package ca.llsutherland.nfl.fixture;

import ca.llsutherland.nfl.domain.Role;
import ca.llsutherland.nfl.facade.FacadeFactory;
import ca.llsutherland.nfl.helper.RoleHelper;
import ca.llsutherland.nfl.util.Constants;


public class RoleFixture {
	
	public static Role createGuestRole(String name) {
		return RoleHelper.createNewRole(name);
	}

	public static Role createGuestRole(Long id, String name) {
		return RoleHelper.createNewRole(id, name);
	}

	public static Role createRegularRole() {
		Role regularRole = new Role();
		regularRole.setName(Constants.ROLE_NAME_REGULAR);
		return regularRole;
	}

	public static Role createPersistedRegularRole() {
		Role regularRole = createRegularRole();
		return FacadeFactory.getCreationFacade().createRole(regularRole);
	}

	public static Role findRegularRole() {
		return FacadeFactory.getFinderFacade().findRoleByName(Constants.ROLE_NAME_REGULAR);
	}

}
